CREATE TABLE [dbo].[TTAUXI_DIST]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_ANNO] [dbo].[TD_IN_004_ANOS] NOT NULL,
[NU_MESE] [dbo].[TD_IN_002_MESE] NOT NULL,
[TI_AUXI_ORIG] [dbo].[TD_VC_001] NOT NULL,
[CO_AUXI_ORIG] [dbo].[TD_VC_020] NOT NULL,
[TI_AUXI_DEST] [dbo].[TD_VC_001] NOT NULL,
[CO_AUXI_DEST] [dbo].[TD_VC_020] NOT NULL,
[PO_DIST] [dbo].[TD_NU_009_004] NULL CONSTRAINT [DF__TTAUXI_DI__PO_DI__004AEFF1] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAUXI_DI__CO_US__013F142A] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAUXI_DI__FE_US__02333863] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAUXI_DI__CO_US__03275C9C] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAUXI_DI__FE_US__041B80D5] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAUXI_DIST] WITH NOCHECK ADD CONSTRAINT [CK__TTAUXI_DI__NU_AN__7E62A77F] CHECK NOT FOR REPLICATION (([NU_ANNO]>(1980)))
GO
ALTER TABLE [dbo].[TTAUXI_DIST] WITH NOCHECK ADD CONSTRAINT [CK__TTAUXI_DI__NU_ME__7F56CBB8] CHECK NOT FOR REPLICATION (([NU_MESE]>=(0) AND [NU_MESE]<=(13)))
GO
ALTER TABLE [dbo].[TTAUXI_DIST] ADD CONSTRAINT [PK__TTAUXI_D__BC830BB9562A98F3] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_ANNO], [NU_MESE], [TI_AUXI_ORIG], [CO_AUXI_ORIG], [TI_AUXI_DEST], [CO_AUXI_DEST]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAUXI_DIST] ADD CONSTRAINT [FK__TTAUXI_DI__CO_EM__3AA27A0F] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
